Exploiting and Protecting Dynamic Code Generation
نویسندگان
چکیده
Many mechanisms have been proposed and deployed to prevent exploits against software vulnerabilities. Among them, W⊕X is one of the most effective and efficient. W⊕X prevents memory pages from being simultaneously writable and executable, rendering the decades old shellcode injection technique infeasible. In this paper, we demonstrate that the traditional shellcode injection attack can be revived through a code cache injection technique. Specifically, dynamic code generation, a technique widely used in just-in-time (JIT) compilation and dynamic binary translation (DBT), generates and modifies code on the fly in order to promote performance or security. The dynamically generated code fragments are stored in a code cache, which is writable and executable either at the same time or alternately, resulting in an opportunity for exploitation. This threat is especially realistic when the generated code is multi-threaded, because switching between writable and executable leaves a time window for exploitation. To illustrate this threat, we have crafted a proofof-concept exploit against modern browsers that support Web Workers. To mitigate this code cache injection threat, we propose a new dynamic code generation architecture. This new architecture relocates the dynamic code generator to a separate process, in which the code cache is writable. In the original process where the generated code executes, the code cache remains readonly. The code cache is synchronized across the writing process and the execution process through shared memory. Interaction between the code generator and the generated code is handled transparently through remote procedure calls (RPC). We have ported the Google V8 JavaScript engine and the Strata DBT to this new architecture. Our implementation experience showed that the engineering effort for porting to this new architecture is minimal. Evaluation of our prototype implementation showed that this new architecture can defeat the code cache injection attack with small performance overhead.
منابع مشابه
Exploiting Symmetries for Optimal Integrated Code Generation
High quality code generation for irregular architectures, such as Digital Signal Processors, is a complex task, as it requires a fully integrated approach that simultaneously deals with the most important tasks of instruction selection, register allocation and instruction scheduling. We show how a fully integrated approach for optimal code generation based on dynamic programming can benefit fro...
متن کاملtcc: A Template-Based Compiler for ‘C
Dynamic code generation is an important technique for improving the performance of software by exploiting information known only at run time. ‘C (Tick C) is a superset of ANSI C that, unlike most prior systems, allows high-level, efficient, and machineindependent specification of dynamically generated code. ‘C provides facilities for dynamic code generation within the context of a statically ty...
متن کاملImportance of protecting the natural reproduction of kutum (Rutilus kutum Kamenskii, 1901) in exploiting the ecological carring capacity of the ecosystem
251 specimens of kutum fish caught by bony fish persine on the southern shores of the Caspian Sea (Mazandaran) during the years 2017-2019 were studied to study the growth trend of this species. In this study, maximum estimated length (L∞) and annual growth coefficient (K) of kutum fish were estimated 71.79 cm and 0.13, respectively. The results of natural reproduction of this species in Kheirud...
متن کاملSecond Generation IMO Intact Stability Vulnerability Criteria and its Application to ships Navigating in Persian Gulf and Oman Sea
Second generation intact stability criteria for few past years had been under development by International Maritime Organization (IMO). Since the draft proposed amendments shall be amended to International code on Intact Stability (IS code 2008), new regulations shall enter into force for ships of length more than 24 meter. Generally second generation intact stability criteria (SGISC) refers to...
متن کاملFreeSentry: protecting against use-after-free vulnerabilities due to dangling pointers
Use-after-free vulnerabilities have become an important class of security problems due to the existence of mitigations that protect against other types of vulnerabilities. The effects of their exploitation can be just as devastating as exploiting a buffer overflow, potentially resulting in full code execution within the vulnerable program. Few protections exist against these types of vulnerabil...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2015